/*
 * LoggerConfigurator.h
 *
 *  Created on: Dec 17, 2008
 *      Author: brt
 */

#ifndef LOGGERCONFIGURATOR_H_
#define LOGGERCONFIGURATOR_H_

#include "../../Utilidade/include/Properties.h"

class LogParameters;

/**
 *
 * This class reads a properties instance and configures the
 * logger parameters instance to match the read properties
 *
 *
 * Meaningful properties are:
 *
 * Key - Values, ...
 * LOG_LEVEL - TRACE, DEBUG, INFO, WARN, ERROR
 * LOG_ENABLED - ON, OFF
 *
 */
class LoggerConfigurator {
public:

	/**
	 *
	 * Creates a instance of the LoggerConfigurator class
	 * @param props The initial properties
	 */
	LoggerConfigurator(Properties& props);
	LoggerConfigurator();

	/**
	 *
	 * Returns the currently set properties
	 * @return The properties
	 *
	 */
	const Properties& Current() const;

	/**
	 *
	 * Add a new group of properties (it won't remove
	 * previously assigned properties, but it does overwrite
	 * existing ones with the same key)
	 *
	 * @param props The properties to be added
	 *
	 */
	void 	    Add(Properties& props);

	/**
	 *
	 * Clear all the assigned properties
	 *
	 */
	void        Clear();

	/**
	 *
	 * Configure the LogParameter global variable with
	 * the existing properties values
	 *
	 */
	void        Configure();

	/**
	 *
	 * Provided for the future. Configure the LogParameter
	 * passed as an argument
	 * @param logParams The parameters to be modified
	 *
	 */
	void        Configure(LogParameters& logParams);


	~LoggerConfigurator();

private:

	Properties m_Properties;
};

#endif /* LOGGERCONFIGURATOR_H_ */
